import { getRolesList } from '@/api/roles.js'

const state = {
  // 获取角色列表
  rolesList: []
}
const mutations = {
  initRolesList(state, payload) {
    state.rolesList = payload
  }
}
const actions = {
  async getRolesList(context) {
    const res = await getRolesList()
    // console.log(res)
    context.commit('initRolesList', res)
  }
}
const getters = {}

export default {
  namespaced: true,
  state,
  mutations,
  actions,
  getters
}
